#!/usr/bin/python
# Filename: backup_ver1.py

import os, time

source = [ '/home/liubin/mysrc/script/python/learn_a_byte_of_python', '/home/liubin/mysrc/script/bash' ]
target_dir = '/home/liubin/data/'

target = target_dir + '/' + time.strftime( "%Y%m%d%H%M%S" ) + '.zip'
zip_cmd = "zip -qr '%s' %s" % (target, ' '.join( source ) )

print zip_cmd

if os.system( zip_cmd ) == 0:
	print 'Success backup to', target
else:
	print 'Backup failed'

